import 'package:bigegg/common/log/xmm_logcat.dart';
import 'package:bigegg/data/repository/xmm_remote_repository.dart';
import 'package:bigegg/global/user/xmm_account_manager.dart';
import 'package:bigegg/page/main/widget/xmm_bottom_navigation_bar.dart';
import 'package:flutter/material.dart';

import '../../entity/main/xmm_tab_bar_item.dart';
import 'page/home/xmm_home_page.dart';
import 'page/im/xmm_im_page.dart';
import 'page/mine/xmm_mine_page.dart';
import 'page/video/xmm_video_page.dart';

class XmmMainPage extends StatefulWidget {
  const XmmMainPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return XmmMainPageState();
  }
}

class XmmMainPageState extends State<XmmMainPage> {
  //底部tabItem
  final List<XmmTabBarItem> _tabItem = [
    XmmTabBarItem(
        normalIcon: 'assets/images/main/xmm_ic_tab_home_normal.png',
        selectIcon: 'assets/images/main/xmm_ic_tab_home_press.png'),
    XmmTabBarItem(
        normalIcon: 'assets/images/main/xmm_ic_tab_video_normal.png',
        selectIcon: 'assets/images/main/xmm_ic_tab_video_press.png'),
    XmmTabBarItem(
        normalIcon: 'assets/images/main/xmm_ic_tab_im_normal.png',
        selectIcon: 'assets/images/main/xmm_ic_tab_im_press.png'),
    XmmTabBarItem(
        normalIcon: 'assets/images/main/xmm_ic_tab_mine_normal.png',
        selectIcon: 'assets/images/main/xmm_ic_tab_mine_press.png'),
  ];

  //tab页面
  final List<Widget> _tabPages = [
    const XmmHomePage(),
    const XmmVideoPage(),
    const XmmImPage(),
    const XmmMinePage(),
  ];

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return XmmBottomNavigationBar(
      tabItems: _tabItem,
      tabPages: _tabPages,
    );
  }
}
